import java.util.Stack;

public class num232 {
    private Stack<Integer> t1 = new Stack<>();
    private Stack<Integer> t2 = new Stack<>();
    public void push(int x) {
        while (!t1.isEmpty()){
            t2.push(t1.pop());
        }
        t1.push(x);
        while (!t2.isEmpty()){
            t1.push(t2.pop());
        }
    }

    public int pop() {
        return t1.pop();
    }

    public int peek() {
        return t1.peek();
    }

    public boolean empty() {
        return t1.isEmpty();
    }
}
